/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.common.constant.excel;

import org.apache.commons.lang3.StringUtils;

/**
 * 资产导入/导出模板Sheet页
 * @author zpy
 * @version v1.0.0
 */
public enum AssetExcelSheet {
    /**物理环境**/
    PHY_ENV("物理环境"),
    PHY_SECURITY( "物理安防设施"),
    PWD_PRODUCT( "密码产品"),
    SERVER_STORAGE( "服务器存储设备"),
    NETWORK_SECURITY( "网络及安全设备"),
    DATABASE("数据库管理系统"),
    KEY_BUSINESS( "关键业务应用"),
    SUB_BUSINESS( "子对象"),
    KEY_DATA( "重要数据"),
    SECURITY_DOC("安全管理文档"),
    PERSONNEL("相关人员");

    private final String name;

    AssetExcelSheet(String name) {
        this.name = name;
    }

    public String getName(){
        return this.name;
    }

    public static AssetExcelSheet fromName(String name){
        AssetExcelSheet data = null;
        for(AssetExcelSheet tt : AssetExcelSheet.values()){
            if(StringUtils.equals(tt.name,name)){
                data = tt;
                break;
            }
        }
        return data;
    }
}